08. Write Your First Promise

Write Your First Promise

1.8 Write Your First Promise Quiz

Instructions

  1. Review the file named Exercise.html in the Workspace below.
  2. Wrap setTimeout in a Promise inside the wait() function. resolve() in setTimeout's callback.
  3. console.log(this) inside the Promise and observe the results.
  4. Make sure wait() returns the Promise too!
  5. When complete, feel free to check out our implementation in the Solution.html file.

Workspace

This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity, so you may be able to download them there.

Workspace Information:

  • Default file path:
  • Workspace type: html-live
  • Opened files (when workspace is loaded): n/a

QUESTION:

What is the scope of this inside the Promise?

SOLUTION:

NOTE: The solutions are expressed in RegEx pattern. Udacity uses these patterns to check the given answer

Solution

1.8 Write Your First Promise Solution